<%@ page import="com.web.CookieTool" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2020/12/11
  Time: 21:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>用户登录</title>
</head>
<body>

   <%! String uname;
       String pwd;
   %>
    <%
        /*Cookie[] cookies=request.getCookies();
        for(Cookie cookie:cookies){
            if(cookie.getName().equals("username")){
                uname=cookie.getValue();
            }
        }*/
        uname=CookieTool.getCookieValueByName(request,"username");
        pwd=CookieTool.getCookieValueByName(request,"password");
    %>
   <%@ include file="banner.jsp" %>
    <h1 style="margin-left: 20%;">用户登录
        <a href="<c:url value="/" />" style="font-size: 20px;margin-left: 100px;">返回首页</a>
    </h1>
    <div id="login" style="height: 300px;text-align: center;">
        <form method="post">
            请输入用户名：<input type="text" name="username" placeholder="username" value="<%=(uname==null?"":uname)%>" style="margin-top: 100px;"><br>
            请输入密码：<input type="password" name="password" placeholder="password" value="<%=(pwd==null?"":pwd)%>"
                         style="margin-top: 30px;margin-left: 15px;"><br>
            <input type="submit" value="登录" style="margin-top: 30px;width: 60px;height: 30px;background-color: #3e68a0;color: white;"></input>
        </form>
    </div>
   <%@ include file="footer.jsp" %>
</body>
</html>
